Xbasic

Array delete Method

Syntax

V <array>.delete(N position[,N count])

Arguments

positionNumeric

The index of the first element to delete.

countNumeric

The number of elements to delete.

Description

delete entries from array.

Discussion

The <array>.delete() method deletes count entries in a single dimensional array starting at position. "Empty" entries in the array are closed up. Contrast this with <array>.clear() which does not close up empty entries.

Example

dim A[4] as C
A[1] = "Orange"
A[2] = "Banana"
A[3] = "Apple"
A[4] = "Pineapple"

? A
= [1] = "Orange"
[2] = "Banana"
[3] = "Apple"
[4] = "Pineapple"

A.delete(2,2)

? A
= [1] = "Orange"
[2] = "Pineapple"
[3] = ""
[4] = ""

See Also